home *** CD-ROM | disk | FTP | other *** search
/ AEMail 2.40 / AEMail v2.40.iso / arexx / html.readme < prev    next >
Text File  |  2000-03-11  |  9KB  |  234 lines

  1. html.readme
  2.  
  3. THIS SCRIPT WILL RUN ON BOTH REGISTERED AND UNREGISTERED COPIES OF AEMAIL
  4.  
  5. The html.aem script is used to read html attachments in email.  It can also
  6. be attached to a function key or menu item and used to activate your
  7. browser to display a web address that is contained within a message.
  8.  
  9. You can also assign this script to the Web Addr exit to directly call your 
  10. browser when you double click on a web address embedded in the message.
  11.  
  12. The script requires the "rexxsupport.library" to run.  This library
  13. normally comes with your Amiga at version 2.1 or greater.
  14.  
  15. When reading HTML attachments, the script uses your browser to read the
  16. HTML file.  This script can use either IBrowse or AWeb to read and display
  17. the html document.  The script will have to be modified to use a different
  18. browser.
  19.  
  20. The script chooses which browser to use based upon the ASSIGN statements in
  21. your system.  If you have more than one browser with the appropriate ASSIGN
  22. statements, it will choose the appropriate browser based on the following
  23. priority:
  24.  
  25.     IBrowse
  26.     AWeb3
  27.     AWeb-II
  28.  
  29. To use a different priority or to remove a particular browser you can
  30. re-arrange or remove the appropriate statement sections that use
  31. SHOWLIST().
  32.  
  33. Also in this directory is an alternate mailcap file which is required for
  34. displaying the html document.  You will notice in the mailcap file the
  35. first line which is as follows:
  36.  
  37.     text/html; "run >NIL: rx html.aem %s"
  38.  
  39. This line calls the html.aem script to display the html attachment with
  40. your browser.  To use the mailcap, the script, "html.aem", should be moved
  41. to your REXX:  directory.  Notice that the call line says "run".  This is
  42. required to allow the script to become detached from AEMail so that ARexx
  43. commands can be directed back to AEMail.  If the "run" is not present,
  44. AEMail will become frozen when you attempt to display the document.
  45.  
  46. You can move this mailcap to your mail directory when you install AEMail
  47. (if you install at the "expert" level) or, using the Viewer page of the
  48. Configuration screen, you can create a "text/html" statement in your
  49. mailcap.  If you use the Viewer page, you do not have to move the script to
  50. the REXX: directory since you can specify the full path name in the rexx
  51. script call.
  52.  
  53.                              HOW TO IMPLEMENT
  54.                              ----------------
  55.  
  56. Copy the mailcap file over your existing mailcap file or create a mailcap
  57. entry for "text/html" in your mailcap using the Viewer page of the
  58. Configuration Setup Window.
  59.  
  60. Move the html.aem script to either your program directory or the REXX:
  61. directory.  If you create your own mailcap with the Viewer page of the
  62. Configuration Setup, you can create a line for:
  63.  
  64.     text/html
  65.  
  66. and locate the ARexx script using the file requester in AEMail's ARexx
  67. drawer.  Be sure the full path is specified.  If you do this you do not
  68. have to move the "html.aem" script.
  69.  
  70. The script is designed specifically for IBrowse or AWeb and must be
  71. modified if another browser is used.
  72.  
  73. At the beginning of the script you will notice the section beginning:
  74.  
  75.     IF (file = "") THEN DO
  76.  
  77. this is used to pick up the variable (the GETVAR statement) that is the URL
  78. when you are activating a web address embedded in a message.  If you are
  79. reading an HTML attachment, the local file address used is passed to the
  80. script so that "file" will not be empty which bypasses these statements.
  81.  
  82. Since IBrowse doesn't normally create an assignment for it's program
  83. directory, you will have to add an assignment for the IBrowse program
  84. directory to your startup sequence.  This is only necessary if you are
  85. using IBrowse.  AWeb does create the assignments.  Note, however, that the
  86. assignment for AWeb3 is all in upper case letters.  Even though the assign
  87. statement specifies upper and lower case letters, you have to specify the
  88. assign with all caps for ARexx to properly find it.
  89.  
  90. If you wish to use another browser, you will have to add an ASSIGN for that
  91. browser's program directory and modify the following statements:
  92.  
  93.     IF SHOWLIST('A', "IBROWSE") THEN
  94.         DO
  95.         wwwdir = "IBROWSE:"
  96.         wwwprog = "IBROWSE:Ibrowse"
  97.         wwwport = "IBROWSE"
  98.         END
  99.  
  100. You would change the SHOWLIST('A', "IBROWSE" line so that it references the
  101. ASSIGN for the directory containing your browser.  You will have to
  102. substitute the directory containing your program ("wwwdir" variable) for
  103. "IBROWSE:", the program name ("wwwprog" variable) for "IBROWSE:Ibrowse",
  104. and the ARexx port name of your browser ("wwwport" variable) will have to
  105. be substituted for "IBROWSE".
  106.  
  107. The section of the script that begins with
  108.  
  109.     IF (wwwport = "AWEB." THEN
  110.  
  111. is used to obtain the port number for AWEB.  If you are using AWeb and AWEB
  112. is not running this will default to AWEB.1
  113.  
  114. The section beginning:
  115.  
  116.     IF ~ SHOW('P', wwwport) THEN
  117.  
  118. is used to load your browser if is not already loaded.
  119.  
  120. The line:
  121.  
  122.     olddir = PRAGMA('D', wwwdir)
  123.  
  124. is used to change the directory to the directory containing your program.
  125. This is necessary with some browsers (especially IBROWSE) so that they can
  126. find the modules and files they need.  IBROWSE gurus in some instance if
  127. this statement is not there.
  128.  
  129. The section beginning:
  130.  
  131.     IF (file2 == 'T:AMtemp') THEN DO
  132.  
  133. is used to set up the URL call for a local file if the file name "T:AMtemp"
  134. is passed to the script.  This is the standard name and place AEMail uses
  135. for temporarily storing attachment files.  The name must be changed to
  136. t:amtemp.html since browsers require the .html suffix on the name.  The
  137. full call that browsers use is:
  138.  
  139.     "file://localhost/t:amtemp.html"
  140.  
  141. which is stored in the variable "file".
  142.  
  143. The final part of the script:
  144.  
  145.  
  146.     ADDRESS VALUE wwwport
  147.  
  148.     IF (wwwport = "IBROWSE") THEN DO
  149.         "INFO SCREEN"
  150.         ADDRESS AEMAIL1 SCREENTOFRONT result
  151.         "GOTOURL" file
  152.         END
  153.     ELSE DO
  154.         "SCREENTOFRONT"
  155.         "OPEN" file
  156.         END
  157.  
  158. causes things to happen a bit differently if you are running IBROWSE versus
  159. AWEB.  The statement:
  160.  
  161.     ADDRESS VALUE wwwport
  162.  
  163. sets your ARexx port to the correct port name.  If the port was "IBROWSE"
  164. then this action takes place:
  165.  
  166.  
  167.     "INFO SCREEN"
  168.  
  169. This obtains the public screen name for your browser.  Since IBROWSE uses
  170. MUI, this is a standard stament for any program using MUI.  The next
  171. statement:
  172.  
  173.     ADDRESS AEMAIL1 SCREENTOFRONT result
  174.  
  175. is a call to AEMail to switch your browser's screen to the front.  "result"
  176. is the screen named obtained through MUI of the browser's public screen.
  177.  
  178. The statement:
  179.  
  180.     "GOTOURL" file
  181.  
  182. is an ARexx call to IBROWSE to display the html document.
  183.  
  184. If your browser is not IBROWSE, then it is assumed to be AWEB.  The
  185. statements after ELSE are used for AWEB.  Since AWEB does not use MUI, it
  186. has its own statement for bring the AWEB screen to the front.  This is:
  187.  
  188.     "SCREENTOFRONT"
  189.  
  190. Then the call to AWEB to display your URL is "OPEN" rather than "GOTOURL"
  191.  
  192.  
  193.                                 HOW TO USE
  194.                                 ----------
  195.  
  196. When you get an email with an html attachment (or text body) call up your
  197. attachment requester, select the appropriate attachment (it will say
  198. "text/html"), and click on VIEW.  Your browser will be loaded (if it is not
  199. already loaded) and the page will be displayed.  You should have an open
  200. connection to your Internet server when you call your browser since many
  201. html attachments obtain information over the internet (such as graphic
  202. images).
  203.  
  204. When you are done viewing the html document you should either close the
  205. browser or switch it's screen to the back to re-display the AEMail screen.
  206.  
  207. For browsers that open on the Workbench, there is an AREXX script called
  208. AEMAIL_TOFRONT.aem.  This script will automatically close your browser and
  209. bring the AEMail screen to the front (see the AEMAIL_TOFRONT.readme) and
  210. must be installed in the AREXX portion of your browser.
  211.  
  212. To use this script to display embedded web addresses in a document you will
  213. have to bind the "html.aem" script to a function key in AEMail and assign a
  214. menu title.  To do this call up the ARexx page of the AEMail configuration
  215. screen and select the function key you want the "html.aem" script bound to.
  216. Enter the script name (full path name) in the string gadget.  Be sure you
  217. have AREXX selected in the cycle gadget.  You can use the file folder glyph
  218. to call up the file requester to locate the script.  Then, if you want a
  219. menu item, enter a menu title in the "Menu Title" string gadget.  Then save
  220. the configuration.
  221.  
  222. When you receive a message with an embedded web address just double click
  223. on the line containing the web address.  The web address will appear in
  224. the Clip window.  Now either hit the function key that you bound the
  225. html.aem script to or select the menu item indicate by the "Menu Title"
  226. and the web page will be called up.  You will, of course, have to be
  227. connected to your Internet provider for this to work.
  228.  
  229. If for any reason your browser can not be loaded, multiview will be called
  230. to display the document as a text document.
  231.  
  232.  
  233.  
  234.